module engine{
    export class Vector2 implements ecs.IEquatable<Vector2> {
        public X: number;
        public Y: number;

        /** 根据两个值用X和Y构造2d向量。 */
        constructor(x: number, y: number){
            this.X = x;
            this.Y = y;
        }

        public Equals(other: Vector2): boolean {
            return (this.X == other.X) && (this.Y == other.Y);
        }

        public static Multiply(value1: Vector2, value2): Vector2{
            value1.X *= value2.X;
            value1.Y *= value2.Y;
            return value1;
        }
    }
}